package two_xia.ex1;

import java.util.Scanner;

public class Client {
    public static void main(String[] args) {
        try {
            Shape shape;
            Scanner scanner = new Scanner(System.in);
            shape = ShapeFactory.createShape(scanner.next());
            if (shape != null) {
                shape.draw();
                shape.erase();
                System.out.println(shape);
            }
            //需要抛出的异常在ShapeFactory方法上
        } catch (UnsupportedShapeException e) {
            System.out.println(e.getMessage());
        }
    }
}
